<template>
  <div>
    <el-tabs v-model="activeName">

      <el-tab-pane name="first">
        <div slot="label" @click="myGoodsClick">发送的申请</div>
        <my-goods ref="myGoods"></my-goods>
      </el-tab-pane>

      <el-tab-pane name="second">
        <div slot="label" @click="recieveGoodsClick">接收的申请</div>
        <recieve-goods ref="recieveGoods"></recieve-goods>
      </el-tab-pane>

    </el-tabs>
  </div>
</template>
<script>
  import MyGoods from './module/goods/send-goods'
  import RecieveGoods from './module/goods/receive-goods'
  export default {
    data() {
      return {
        activeName: 'first'
      }
    },
    components: {
      MyGoods,
      RecieveGoods
    },
    activated() {
      this.myGoodsClick()
    },
    methods: {
      myGoodsClick() {
        this.$nextTick(() => {
          this.$refs.myGoods.getDataList()
        })
      },
      recieveGoodsClick() {
        this.$nextTick(() => {
          this.$refs.recieveGoods.getDataList()
        })
      }
    }
  }
</script>